package com.tan.androidtest.javatest.callback;

/**
 * 测试回调
 */

public class CallBackTest {

    public static void main(String[] args) {
        Caller caller=new CallBackTest().new Caller();
        caller.setCallBack(new CallBack() {
            @Override
            public void onCallBack() {
                System.out.println("============");
            }
        });
        caller.call();
    }

    class Caller {

        private CallBack callBack;

        public void setCallBack(CallBack callBack) {
            this.callBack = callBack;
        }

        public void call(){
            callBack.onCallBack();
        }

    }


}
